﻿Imports DataAccess
Imports DTO


Public Class BSAlarm
    Dim serverName1 As String
    Public Sub New(ByVal serverName As String)
        serverName1 = serverName
        DAAlarm.ConfigServerName(serverName)
    End Sub

    '/******************************************************************/
    '/*                          Insert Alarm                          */
    '/******************************************************************/
    Public Function InsertAlarm(ByVal machineNo As Integer, ByVal alarmNo As Integer, ByVal alarmTime As Integer,
                                ByVal createDateTime As DateTime, ByVal updateDateTime As DateTime) As Integer
        Dim dtoAlarm As New DTOAlarm
        dtoAlarm.MachineNoProperty = machineNo
        dtoAlarm.AlarmNoProperty = alarmNo
        dtoAlarm.AlarmTimeProperty = alarmTime
        dtoAlarm.CreateDateTimeProperty = createDateTime
        dtoAlarm.UpdateDateTimeProperty = updateDateTime
        Return DAAlarm.InsertAlarm(dtoAlarm)
    End Function
    '/******************************************************************/
    '/*                  Delete Alarm with MachineNo                   */
    '/******************************************************************/
    Public Function DeleteAlarm(ByVal machineNo As Integer) As Integer
        Return DAAlarm.DeleteAlarm(machineNo)
    End Function
    '/******************************************************************/
    '/*                     Get Alarm with MachineNo                   */
    '/******************************************************************/
    Public Function GetAlarm(ByVal machineNo As Integer) As DataTable
        Return DAAlarm.GetAlarm(machineNo)
    End Function
End Class
